//
//  shopPickerDataSource.m
//  MoneyBook
//
//  Created by Justin Kim on 11. 6. 28..
//  Copyright 2011 Daum. All rights reserved.
//

#import "ShopPickerDataSource.h"
#import "SQLHandler.h"

@implementation ShopPickerDataSource

@synthesize shopPickerArray = _shopPickerArray;


/////////////////////////////////////////////////////////////////////////////////////////////////
- (id)init{
	self = [super init];
	if (self){
        self.shopPickerArray = [[SQLHandler sharedInstance] findAllShop];
    }
    return self;
}

/////////////////////////////////////////////////////////////////////////////////////////////////
- (void)dealloc{
	[_shopPickerArray release];
	
    [super dealloc];
}

#pragma mark -
#pragma mark UIPickerViewDataSource
/////////////////////////////////////////////////////////////////////////////////////////////////
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{
//    NSLog(@"numberOfRowsInComponent");
    return [_shopPickerArray count];
}

/////////////////////////////////////////////////////////////////////////////////////////////////
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{
//    NSLog(@"numberOfComponentsInPickerView");
    return 1;
}

-(void)reloadData{
    self.shopPickerArray = [[SQLHandler sharedInstance] findAllShop];    
}
@end
